package com.example.demo5;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * 服务端
 */
public class Server {
    public static final String FILE_PATH = "day25-final-test/src/users.properties";

    public static void main(String[] args) {
        try {
            // 1.注册端口
            ServerSocket serverSocket = new ServerSocket(8888);
            while (true) {
                // 2.开始接收客户端的请求
                Socket socket = serverSocket.accept();
                // 3.分配一个独立的线程来处理客户端的请求
                new ServerReaderThread(socket).start();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
